//////////////////////////////////////////////////////////////////////////
/// Copyright (c) 2011, Sidorenko 'PC' Alexander                       ///
/// mailto: sidorenko /*dot*/ alexander (at) gmail [dot] com           ///
/// This file is a part of the Radiating Gas Dynamics project          ///
//////////////////////////////////////////////////////////////////////////

#ifndef BrickProblem_INCLUDED
#define BrickProblem_INCLUDED

#include "ProblemN.h"

class BrickProblem : public ProblemN<2>
{
public:

	BrickProblem(gdScalar gamma, gdScalar cfl, unsigned int numThreads, unsigned int timesteps, BOOL saveFull, BOOL sphere, unsigned int brickSizeDivider,
				 gdScalar speed);
	virtual ~BrickProblem();

	void initGrid(gdScalar xMax, unsigned int numCells,
				  // Solving parameters (for Riemann Solver)
				  gdScalar tolerance, unsigned int stepsThreshold);

	// Overloaded from Problem
	virtual unsigned int getNumPlotTypes() const;
	virtual std::string getPlotTypeName(unsigned int id) const;
	virtual bool plotSolution(CDC& dc, const CRect& dstRect, const CColorBar& clr, unsigned int timeStep, unsigned int pType);

private:

	// Overloaded from GodunovSolver
	virtual void generateGrid();
	virtual void generateInitialDistributions();
	virtual void applyBoundaryConditions();

	// Overloaded from Problem
	virtual void solveRadiation(gdScalar timeDelta);

	gdScalar m_xMax;

	// i indices of the brick faces
	unsigned int m_t, m_b;

	// j indices of the brick faces
	unsigned int m_l, m_r;

	unsigned int m_brickSizeDivider;

	gdScalar m_speed;

	// Array indices of 4 extra ghost cells
	// that are required to create corners
	unsigned int m_tl, m_tr, m_bl, m_br;

	BOOL m_sphere;

};

#endif // BrickProblem_INCLUDED